
_loop：     文件格式 elf32-i386


Disassembly of section .text:

00000000 <main>:
#include "stat.h"
#include "user.h"

int
main(int argc, char *argv[])
{
   0:	8d 4c 24 04          	lea    0x4(%esp),%ecx
   4:	83 e4 f0             	and    $0xfffffff0,%esp
   7:	ff 71 fc             	push   -0x4(%ecx)
   a:	55                   	push   %ebp
   b:	89 e5                	mov    %esp,%ebp
   d:	51                   	push   %ecx
   e:	83 ec 14             	sub    $0x14,%esp
  int i,j;
  i=fork();
  11:	e8 03 03 00 00       	call   319 <fork>
  16:	89 45 f0             	mov    %eax,-0x10(%ebp)
  if(i==0){
  19:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  1d:	75 53                	jne    72 <main+0x72>
      //child
      for(j=0;j<100000;j++)//do some computation
  1f:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  26:	eb 3c                	jmp    64 <main+0x64>
      {
          if(j%1000==0){
  28:	8b 4d f4             	mov    -0xc(%ebp),%ecx
  2b:	ba d3 4d 62 10       	mov    $0x10624dd3,%edx
  30:	89 c8                	mov    %ecx,%eax
  32:	f7 ea                	imul   %edx
  34:	89 d0                	mov    %edx,%eax
  36:	c1 f8 06             	sar    $0x6,%eax
  39:	89 ca                	mov    %ecx,%edx
  3b:	c1 fa 1f             	sar    $0x1f,%edx
  3e:	29 d0                	sub    %edx,%eax
  40:	69 d0 e8 03 00 00    	imul   $0x3e8,%eax,%edx
  46:	89 c8                	mov    %ecx,%eax
  48:	29 d0                	sub    %edx,%eax
  4a:	85 c0                	test   %eax,%eax
  4c:	75 12                	jne    60 <main+0x60>
              printf(1," c ");
  4e:	83 ec 08             	sub    $0x8,%esp
  51:	68 5c 08 00 00       	push   $0x85c
  56:	6a 01                	push   $0x1
  58:	e8 48 04 00 00       	call   4a5 <printf>
  5d:	83 c4 10             	add    $0x10,%esp
      for(j=0;j<100000;j++)//do some computation
  60:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  64:	81 7d f4 9f 86 01 00 	cmpl   $0x1869f,-0xc(%ebp)
  6b:	7e bb                	jle    28 <main+0x28>
          }
      }
      exit();
  6d:	e8 af 02 00 00       	call   321 <exit>
  }else{//parent
       for(j=0;j<100000;j++)//do some computation
  72:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  79:	eb 3c                	jmp    b7 <main+0xb7>
      {
          if(j%1000==0){
  7b:	8b 4d f4             	mov    -0xc(%ebp),%ecx
  7e:	ba d3 4d 62 10       	mov    $0x10624dd3,%edx
  83:	89 c8                	mov    %ecx,%eax
  85:	f7 ea                	imul   %edx
  87:	89 d0                	mov    %edx,%eax
  89:	c1 f8 06             	sar    $0x6,%eax
  8c:	89 ca                	mov    %ecx,%edx
  8e:	c1 fa 1f             	sar    $0x1f,%edx
  91:	29 d0                	sub    %edx,%eax
  93:	69 d0 e8 03 00 00    	imul   $0x3e8,%eax,%edx
  99:	89 c8                	mov    %ecx,%eax
  9b:	29 d0                	sub    %edx,%eax
  9d:	85 c0                	test   %eax,%eax
  9f:	75 12                	jne    b3 <main+0xb3>
              printf(1," p ");
  a1:	83 ec 08             	sub    $0x8,%esp
  a4:	68 60 08 00 00       	push   $0x860
  a9:	6a 01                	push   $0x1
  ab:	e8 f5 03 00 00       	call   4a5 <printf>
  b0:	83 c4 10             	add    $0x10,%esp
       for(j=0;j<100000;j++)//do some computation
  b3:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  b7:	81 7d f4 9f 86 01 00 	cmpl   $0x1869f,-0xc(%ebp)
  be:	7e bb                	jle    7b <main+0x7b>
          }
      }
      wait();
  c0:	e8 64 02 00 00       	call   329 <wait>
  }
  exit();
  c5:	e8 57 02 00 00       	call   321 <exit>

000000ca <stosb>:
               "cc");
}

static inline void
stosb(void *addr, int data, int cnt)
{
  ca:	55                   	push   %ebp
  cb:	89 e5                	mov    %esp,%ebp
  cd:	57                   	push   %edi
  ce:	53                   	push   %ebx
  asm volatile("cld; rep stosb" :
  cf:	8b 4d 08             	mov    0x8(%ebp),%ecx
  d2:	8b 55 10             	mov    0x10(%ebp),%edx
  d5:	8b 45 0c             	mov    0xc(%ebp),%eax
  d8:	89 cb                	mov    %ecx,%ebx
  da:	89 df                	mov    %ebx,%edi
  dc:	89 d1                	mov    %edx,%ecx
  de:	fc                   	cld    
  df:	f3 aa                	rep stos %al,%es:(%edi)
  e1:	89 ca                	mov    %ecx,%edx
  e3:	89 fb                	mov    %edi,%ebx
  e5:	89 5d 08             	mov    %ebx,0x8(%ebp)
  e8:	89 55 10             	mov    %edx,0x10(%ebp)
               "=D" (addr), "=c" (cnt) :
               "0" (addr), "1" (cnt), "a" (data) :
               "memory", "cc");
}
  eb:	90                   	nop
  ec:	5b                   	pop    %ebx
  ed:	5f                   	pop    %edi
  ee:	5d                   	pop    %ebp
  ef:	c3                   	ret    

000000f0 <strcpy>:
#include "user.h"
#include "x86.h"

char*
strcpy(char *s, char *t)
{
  f0:	55                   	push   %ebp
  f1:	89 e5                	mov    %esp,%ebp
  f3:	83 ec 10             	sub    $0x10,%esp
  char *os;

  os = s;
  f6:	8b 45 08             	mov    0x8(%ebp),%eax
  f9:	89 45 fc             	mov    %eax,-0x4(%ebp)
  while((*s++ = *t++) != 0)
  fc:	90                   	nop
  fd:	8b 55 0c             	mov    0xc(%ebp),%edx
 100:	8d 42 01             	lea    0x1(%edx),%eax
 103:	89 45 0c             	mov    %eax,0xc(%ebp)
 106:	8b 45 08             	mov    0x8(%ebp),%eax
 109:	8d 48 01             	lea    0x1(%eax),%ecx
 10c:	89 4d 08             	mov    %ecx,0x8(%ebp)
 10f:	0f b6 12             	movzbl (%edx),%edx
 112:	88 10                	mov    %dl,(%eax)
 114:	0f b6 00             	movzbl (%eax),%eax
 117:	84 c0                	test   %al,%al
 119:	75 e2                	jne    fd <strcpy+0xd>
    ;
  return os;
 11b:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 11e:	c9                   	leave  
 11f:	c3                   	ret    

00000120 <strcmp>:

int
strcmp(const char *p, const char *q)
{
 120:	55                   	push   %ebp
 121:	89 e5                	mov    %esp,%ebp
  while(*p && *p == *q)
 123:	eb 08                	jmp    12d <strcmp+0xd>
    p++, q++;
 125:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 129:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
  while(*p && *p == *q)
 12d:	8b 45 08             	mov    0x8(%ebp),%eax
 130:	0f b6 00             	movzbl (%eax),%eax
 133:	84 c0                	test   %al,%al
 135:	74 10                	je     147 <strcmp+0x27>
 137:	8b 45 08             	mov    0x8(%ebp),%eax
 13a:	0f b6 10             	movzbl (%eax),%edx
 13d:	8b 45 0c             	mov    0xc(%ebp),%eax
 140:	0f b6 00             	movzbl (%eax),%eax
 143:	38 c2                	cmp    %al,%dl
 145:	74 de                	je     125 <strcmp+0x5>
  return (uchar)*p - (uchar)*q;
 147:	8b 45 08             	mov    0x8(%ebp),%eax
 14a:	0f b6 00             	movzbl (%eax),%eax
 14d:	0f b6 d0             	movzbl %al,%edx
 150:	8b 45 0c             	mov    0xc(%ebp),%eax
 153:	0f b6 00             	movzbl (%eax),%eax
 156:	0f b6 c8             	movzbl %al,%ecx
 159:	89 d0                	mov    %edx,%eax
 15b:	29 c8                	sub    %ecx,%eax
}
 15d:	5d                   	pop    %ebp
 15e:	c3                   	ret    

0000015f <strlen>:

uint
strlen(char *s)
{
 15f:	55                   	push   %ebp
 160:	89 e5                	mov    %esp,%ebp
 162:	83 ec 10             	sub    $0x10,%esp
  int n;

  for(n = 0; s[n]; n++)
 165:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
 16c:	eb 04                	jmp    172 <strlen+0x13>
 16e:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 172:	8b 55 fc             	mov    -0x4(%ebp),%edx
 175:	8b 45 08             	mov    0x8(%ebp),%eax
 178:	01 d0                	add    %edx,%eax
 17a:	0f b6 00             	movzbl (%eax),%eax
 17d:	84 c0                	test   %al,%al
 17f:	75 ed                	jne    16e <strlen+0xf>
    ;
  return n;
 181:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 184:	c9                   	leave  
 185:	c3                   	ret    

00000186 <memset>:

void*
memset(void *dst, int c, uint n)
{
 186:	55                   	push   %ebp
 187:	89 e5                	mov    %esp,%ebp
  stosb(dst, c, n);
 189:	8b 45 10             	mov    0x10(%ebp),%eax
 18c:	50                   	push   %eax
 18d:	ff 75 0c             	push   0xc(%ebp)
 190:	ff 75 08             	push   0x8(%ebp)
 193:	e8 32 ff ff ff       	call   ca <stosb>
 198:	83 c4 0c             	add    $0xc,%esp
  return dst;
 19b:	8b 45 08             	mov    0x8(%ebp),%eax
}
 19e:	c9                   	leave  
 19f:	c3                   	ret    

000001a0 <strchr>:

char*
strchr(const char *s, char c)
{
 1a0:	55                   	push   %ebp
 1a1:	89 e5                	mov    %esp,%ebp
 1a3:	83 ec 04             	sub    $0x4,%esp
 1a6:	8b 45 0c             	mov    0xc(%ebp),%eax
 1a9:	88 45 fc             	mov    %al,-0x4(%ebp)
  for(; *s; s++)
 1ac:	eb 14                	jmp    1c2 <strchr+0x22>
    if(*s == c)
 1ae:	8b 45 08             	mov    0x8(%ebp),%eax
 1b1:	0f b6 00             	movzbl (%eax),%eax
 1b4:	38 45 fc             	cmp    %al,-0x4(%ebp)
 1b7:	75 05                	jne    1be <strchr+0x1e>
      return (char*)s;
 1b9:	8b 45 08             	mov    0x8(%ebp),%eax
 1bc:	eb 13                	jmp    1d1 <strchr+0x31>
  for(; *s; s++)
 1be:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 1c2:	8b 45 08             	mov    0x8(%ebp),%eax
 1c5:	0f b6 00             	movzbl (%eax),%eax
 1c8:	84 c0                	test   %al,%al
 1ca:	75 e2                	jne    1ae <strchr+0xe>
  return 0;
 1cc:	b8 00 00 00 00       	mov    $0x0,%eax
}
 1d1:	c9                   	leave  
 1d2:	c3                   	ret    

000001d3 <gets>:

char*
gets(char *buf, int max)
{
 1d3:	55                   	push   %ebp
 1d4:	89 e5                	mov    %esp,%ebp
 1d6:	83 ec 18             	sub    $0x18,%esp
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 1d9:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
 1e0:	eb 42                	jmp    224 <gets+0x51>
    cc = read(0, &c, 1);
 1e2:	83 ec 04             	sub    $0x4,%esp
 1e5:	6a 01                	push   $0x1
 1e7:	8d 45 ef             	lea    -0x11(%ebp),%eax
 1ea:	50                   	push   %eax
 1eb:	6a 00                	push   $0x0
 1ed:	e8 47 01 00 00       	call   339 <read>
 1f2:	83 c4 10             	add    $0x10,%esp
 1f5:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if(cc < 1)
 1f8:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 1fc:	7e 33                	jle    231 <gets+0x5e>
      break;
    buf[i++] = c;
 1fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
 201:	8d 50 01             	lea    0x1(%eax),%edx
 204:	89 55 f4             	mov    %edx,-0xc(%ebp)
 207:	89 c2                	mov    %eax,%edx
 209:	8b 45 08             	mov    0x8(%ebp),%eax
 20c:	01 c2                	add    %eax,%edx
 20e:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 212:	88 02                	mov    %al,(%edx)
    if(c == '\n' || c == '\r')
 214:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 218:	3c 0a                	cmp    $0xa,%al
 21a:	74 16                	je     232 <gets+0x5f>
 21c:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 220:	3c 0d                	cmp    $0xd,%al
 222:	74 0e                	je     232 <gets+0x5f>
  for(i=0; i+1 < max; ){
 224:	8b 45 f4             	mov    -0xc(%ebp),%eax
 227:	83 c0 01             	add    $0x1,%eax
 22a:	39 45 0c             	cmp    %eax,0xc(%ebp)
 22d:	7f b3                	jg     1e2 <gets+0xf>
 22f:	eb 01                	jmp    232 <gets+0x5f>
      break;
 231:	90                   	nop
      break;
  }
  buf[i] = '\0';
 232:	8b 55 f4             	mov    -0xc(%ebp),%edx
 235:	8b 45 08             	mov    0x8(%ebp),%eax
 238:	01 d0                	add    %edx,%eax
 23a:	c6 00 00             	movb   $0x0,(%eax)
  return buf;
 23d:	8b 45 08             	mov    0x8(%ebp),%eax
}
 240:	c9                   	leave  
 241:	c3                   	ret    

00000242 <stat>:

int
stat(char *n, struct stat *st)
{
 242:	55                   	push   %ebp
 243:	89 e5                	mov    %esp,%ebp
 245:	83 ec 18             	sub    $0x18,%esp
  int fd;
  int r;

  fd = open(n, O_RDONLY);
 248:	83 ec 08             	sub    $0x8,%esp
 24b:	6a 00                	push   $0x0
 24d:	ff 75 08             	push   0x8(%ebp)
 250:	e8 0c 01 00 00       	call   361 <open>
 255:	83 c4 10             	add    $0x10,%esp
 258:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(fd < 0)
 25b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 25f:	79 07                	jns    268 <stat+0x26>
    return -1;
 261:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
 266:	eb 25                	jmp    28d <stat+0x4b>
  r = fstat(fd, st);
 268:	83 ec 08             	sub    $0x8,%esp
 26b:	ff 75 0c             	push   0xc(%ebp)
 26e:	ff 75 f4             	push   -0xc(%ebp)
 271:	e8 03 01 00 00       	call   379 <fstat>
 276:	83 c4 10             	add    $0x10,%esp
 279:	89 45 f0             	mov    %eax,-0x10(%ebp)
  close(fd);
 27c:	83 ec 0c             	sub    $0xc,%esp
 27f:	ff 75 f4             	push   -0xc(%ebp)
 282:	e8 c2 00 00 00       	call   349 <close>
 287:	83 c4 10             	add    $0x10,%esp
  return r;
 28a:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
 28d:	c9                   	leave  
 28e:	c3                   	ret    

0000028f <atoi>:

int
atoi(const char *s)
{
 28f:	55                   	push   %ebp
 290:	89 e5                	mov    %esp,%ebp
 292:	83 ec 10             	sub    $0x10,%esp
  int n;

  n = 0;
 295:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  while('0' <= *s && *s <= '9')
 29c:	eb 25                	jmp    2c3 <atoi+0x34>
    n = n*10 + *s++ - '0';
 29e:	8b 55 fc             	mov    -0x4(%ebp),%edx
 2a1:	89 d0                	mov    %edx,%eax
 2a3:	c1 e0 02             	shl    $0x2,%eax
 2a6:	01 d0                	add    %edx,%eax
 2a8:	01 c0                	add    %eax,%eax
 2aa:	89 c1                	mov    %eax,%ecx
 2ac:	8b 45 08             	mov    0x8(%ebp),%eax
 2af:	8d 50 01             	lea    0x1(%eax),%edx
 2b2:	89 55 08             	mov    %edx,0x8(%ebp)
 2b5:	0f b6 00             	movzbl (%eax),%eax
 2b8:	0f be c0             	movsbl %al,%eax
 2bb:	01 c8                	add    %ecx,%eax
 2bd:	83 e8 30             	sub    $0x30,%eax
 2c0:	89 45 fc             	mov    %eax,-0x4(%ebp)
  while('0' <= *s && *s <= '9')
 2c3:	8b 45 08             	mov    0x8(%ebp),%eax
 2c6:	0f b6 00             	movzbl (%eax),%eax
 2c9:	3c 2f                	cmp    $0x2f,%al
 2cb:	7e 0a                	jle    2d7 <atoi+0x48>
 2cd:	8b 45 08             	mov    0x8(%ebp),%eax
 2d0:	0f b6 00             	movzbl (%eax),%eax
 2d3:	3c 39                	cmp    $0x39,%al
 2d5:	7e c7                	jle    29e <atoi+0xf>
  return n;
 2d7:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 2da:	c9                   	leave  
 2db:	c3                   	ret    

000002dc <memmove>:

void*
memmove(void *vdst, void *vsrc, int n)
{
 2dc:	55                   	push   %ebp
 2dd:	89 e5                	mov    %esp,%ebp
 2df:	83 ec 10             	sub    $0x10,%esp
  char *dst, *src;

  dst = vdst;
 2e2:	8b 45 08             	mov    0x8(%ebp),%eax
 2e5:	89 45 fc             	mov    %eax,-0x4(%ebp)
  src = vsrc;
 2e8:	8b 45 0c             	mov    0xc(%ebp),%eax
 2eb:	89 45 f8             	mov    %eax,-0x8(%ebp)
  while(n-- > 0)
 2ee:	eb 17                	jmp    307 <memmove+0x2b>
    *dst++ = *src++;
 2f0:	8b 55 f8             	mov    -0x8(%ebp),%edx
 2f3:	8d 42 01             	lea    0x1(%edx),%eax
 2f6:	89 45 f8             	mov    %eax,-0x8(%ebp)
 2f9:	8b 45 fc             	mov    -0x4(%ebp),%eax
 2fc:	8d 48 01             	lea    0x1(%eax),%ecx
 2ff:	89 4d fc             	mov    %ecx,-0x4(%ebp)
 302:	0f b6 12             	movzbl (%edx),%edx
 305:	88 10                	mov    %dl,(%eax)
  while(n-- > 0)
 307:	8b 45 10             	mov    0x10(%ebp),%eax
 30a:	8d 50 ff             	lea    -0x1(%eax),%edx
 30d:	89 55 10             	mov    %edx,0x10(%ebp)
 310:	85 c0                	test   %eax,%eax
 312:	7f dc                	jg     2f0 <memmove+0x14>
  return vdst;
 314:	8b 45 08             	mov    0x8(%ebp),%eax
}
 317:	c9                   	leave  
 318:	c3                   	ret    

00000319 <fork>:
  name: \
    movl $SYS_ ## name, %eax; \
    int $T_SYSCALL; \
    ret

SYSCALL(fork)
 319:	b8 01 00 00 00       	mov    $0x1,%eax
 31e:	cd 40                	int    $0x40
 320:	c3                   	ret    

00000321 <exit>:
SYSCALL(exit)
 321:	b8 02 00 00 00       	mov    $0x2,%eax
 326:	cd 40                	int    $0x40
 328:	c3                   	ret    

00000329 <wait>:
SYSCALL(wait)
 329:	b8 03 00 00 00       	mov    $0x3,%eax
 32e:	cd 40                	int    $0x40
 330:	c3                   	ret    

00000331 <pipe>:
SYSCALL(pipe)
 331:	b8 04 00 00 00       	mov    $0x4,%eax
 336:	cd 40                	int    $0x40
 338:	c3                   	ret    

00000339 <read>:
SYSCALL(read)
 339:	b8 05 00 00 00       	mov    $0x5,%eax
 33e:	cd 40                	int    $0x40
 340:	c3                   	ret    

00000341 <write>:
SYSCALL(write)
 341:	b8 10 00 00 00       	mov    $0x10,%eax
 346:	cd 40                	int    $0x40
 348:	c3                   	ret    

00000349 <close>:
SYSCALL(close)
 349:	b8 15 00 00 00       	mov    $0x15,%eax
 34e:	cd 40                	int    $0x40
 350:	c3                   	ret    

00000351 <kill>:
SYSCALL(kill)
 351:	b8 06 00 00 00       	mov    $0x6,%eax
 356:	cd 40                	int    $0x40
 358:	c3                   	ret    

00000359 <exec>:
SYSCALL(exec)
 359:	b8 07 00 00 00       	mov    $0x7,%eax
 35e:	cd 40                	int    $0x40
 360:	c3                   	ret    

00000361 <open>:
SYSCALL(open)
 361:	b8 0f 00 00 00       	mov    $0xf,%eax
 366:	cd 40                	int    $0x40
 368:	c3                   	ret    

00000369 <mknod>:
SYSCALL(mknod)
 369:	b8 11 00 00 00       	mov    $0x11,%eax
 36e:	cd 40                	int    $0x40
 370:	c3                   	ret    

00000371 <unlink>:
SYSCALL(unlink)
 371:	b8 12 00 00 00       	mov    $0x12,%eax
 376:	cd 40                	int    $0x40
 378:	c3                   	ret    

00000379 <fstat>:
SYSCALL(fstat)
 379:	b8 08 00 00 00       	mov    $0x8,%eax
 37e:	cd 40                	int    $0x40
 380:	c3                   	ret    

00000381 <link>:
SYSCALL(link)
 381:	b8 13 00 00 00       	mov    $0x13,%eax
 386:	cd 40                	int    $0x40
 388:	c3                   	ret    

00000389 <mkdir>:
SYSCALL(mkdir)
 389:	b8 14 00 00 00       	mov    $0x14,%eax
 38e:	cd 40                	int    $0x40
 390:	c3                   	ret    

00000391 <chdir>:
SYSCALL(chdir)
 391:	b8 09 00 00 00       	mov    $0x9,%eax
 396:	cd 40                	int    $0x40
 398:	c3                   	ret    

00000399 <dup>:
SYSCALL(dup)
 399:	b8 0a 00 00 00       	mov    $0xa,%eax
 39e:	cd 40                	int    $0x40
 3a0:	c3                   	ret    

000003a1 <getpid>:
SYSCALL(getpid)
 3a1:	b8 0b 00 00 00       	mov    $0xb,%eax
 3a6:	cd 40                	int    $0x40
 3a8:	c3                   	ret    

000003a9 <sbrk>:
SYSCALL(sbrk)
 3a9:	b8 0c 00 00 00       	mov    $0xc,%eax
 3ae:	cd 40                	int    $0x40
 3b0:	c3                   	ret    

000003b1 <sleep>:
SYSCALL(sleep)
 3b1:	b8 0d 00 00 00       	mov    $0xd,%eax
 3b6:	cd 40                	int    $0x40
 3b8:	c3                   	ret    

000003b9 <uptime>:
SYSCALL(uptime)
 3b9:	b8 0e 00 00 00       	mov    $0xe,%eax
 3be:	cd 40                	int    $0x40
 3c0:	c3                   	ret    

000003c1 <shutdown>:
SYSCALL(shutdown)
 3c1:	b8 16 00 00 00       	mov    $0x16,%eax
 3c6:	cd 40                	int    $0x40
 3c8:	c3                   	ret    

000003c9 <get_free_frame_cnt>:
SYSCALL(get_free_frame_cnt)
 3c9:	b8 17 00 00 00       	mov    $0x17,%eax
 3ce:	cd 40                	int    $0x40
 3d0:	c3                   	ret    

000003d1 <putc>:
#include "stat.h"
#include "user.h"

static void
putc(int fd, char c)
{
 3d1:	55                   	push   %ebp
 3d2:	89 e5                	mov    %esp,%ebp
 3d4:	83 ec 18             	sub    $0x18,%esp
 3d7:	8b 45 0c             	mov    0xc(%ebp),%eax
 3da:	88 45 f4             	mov    %al,-0xc(%ebp)
  write(fd, &c, 1);
 3dd:	83 ec 04             	sub    $0x4,%esp
 3e0:	6a 01                	push   $0x1
 3e2:	8d 45 f4             	lea    -0xc(%ebp),%eax
 3e5:	50                   	push   %eax
 3e6:	ff 75 08             	push   0x8(%ebp)
 3e9:	e8 53 ff ff ff       	call   341 <write>
 3ee:	83 c4 10             	add    $0x10,%esp
}
 3f1:	90                   	nop
 3f2:	c9                   	leave  
 3f3:	c3                   	ret    

000003f4 <printint>:

static void
printint(int fd, int xx, int base, int sgn)
{
 3f4:	55                   	push   %ebp
 3f5:	89 e5                	mov    %esp,%ebp
 3f7:	83 ec 28             	sub    $0x28,%esp
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
 3fa:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  if(sgn && xx < 0){
 401:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
 405:	74 17                	je     41e <printint+0x2a>
 407:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 40b:	79 11                	jns    41e <printint+0x2a>
    neg = 1;
 40d:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
    x = -xx;
 414:	8b 45 0c             	mov    0xc(%ebp),%eax
 417:	f7 d8                	neg    %eax
 419:	89 45 ec             	mov    %eax,-0x14(%ebp)
 41c:	eb 06                	jmp    424 <printint+0x30>
  } else {
    x = xx;
 41e:	8b 45 0c             	mov    0xc(%ebp),%eax
 421:	89 45 ec             	mov    %eax,-0x14(%ebp)
  }

  i = 0;
 424:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  do{
    buf[i++] = digits[x % base];
 42b:	8b 4d 10             	mov    0x10(%ebp),%ecx
 42e:	8b 45 ec             	mov    -0x14(%ebp),%eax
 431:	ba 00 00 00 00       	mov    $0x0,%edx
 436:	f7 f1                	div    %ecx
 438:	89 d1                	mov    %edx,%ecx
 43a:	8b 45 f4             	mov    -0xc(%ebp),%eax
 43d:	8d 50 01             	lea    0x1(%eax),%edx
 440:	89 55 f4             	mov    %edx,-0xc(%ebp)
 443:	0f b6 91 b0 0a 00 00 	movzbl 0xab0(%ecx),%edx
 44a:	88 54 05 dc          	mov    %dl,-0x24(%ebp,%eax,1)
  }while((x /= base) != 0);
 44e:	8b 4d 10             	mov    0x10(%ebp),%ecx
 451:	8b 45 ec             	mov    -0x14(%ebp),%eax
 454:	ba 00 00 00 00       	mov    $0x0,%edx
 459:	f7 f1                	div    %ecx
 45b:	89 45 ec             	mov    %eax,-0x14(%ebp)
 45e:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 462:	75 c7                	jne    42b <printint+0x37>
  if(neg)
 464:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 468:	74 2d                	je     497 <printint+0xa3>
    buf[i++] = '-';
 46a:	8b 45 f4             	mov    -0xc(%ebp),%eax
 46d:	8d 50 01             	lea    0x1(%eax),%edx
 470:	89 55 f4             	mov    %edx,-0xc(%ebp)
 473:	c6 44 05 dc 2d       	movb   $0x2d,-0x24(%ebp,%eax,1)

  while(--i >= 0)
 478:	eb 1d                	jmp    497 <printint+0xa3>
    putc(fd, buf[i]);
 47a:	8d 55 dc             	lea    -0x24(%ebp),%edx
 47d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 480:	01 d0                	add    %edx,%eax
 482:	0f b6 00             	movzbl (%eax),%eax
 485:	0f be c0             	movsbl %al,%eax
 488:	83 ec 08             	sub    $0x8,%esp
 48b:	50                   	push   %eax
 48c:	ff 75 08             	push   0x8(%ebp)
 48f:	e8 3d ff ff ff       	call   3d1 <putc>
 494:	83 c4 10             	add    $0x10,%esp
  while(--i >= 0)
 497:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
 49b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 49f:	79 d9                	jns    47a <printint+0x86>
}
 4a1:	90                   	nop
 4a2:	90                   	nop
 4a3:	c9                   	leave  
 4a4:	c3                   	ret    

000004a5 <printf>:

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 4a5:	55                   	push   %ebp
 4a6:	89 e5                	mov    %esp,%ebp
 4a8:	83 ec 28             	sub    $0x28,%esp
  char *s;
  int c, i, state;
  uint *ap;

  state = 0;
 4ab:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  ap = (uint*)(void*)&fmt + 1;
 4b2:	8d 45 0c             	lea    0xc(%ebp),%eax
 4b5:	83 c0 04             	add    $0x4,%eax
 4b8:	89 45 e8             	mov    %eax,-0x18(%ebp)
  for(i = 0; fmt[i]; i++){
 4bb:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
 4c2:	e9 59 01 00 00       	jmp    620 <printf+0x17b>
    c = fmt[i] & 0xff;
 4c7:	8b 55 0c             	mov    0xc(%ebp),%edx
 4ca:	8b 45 f0             	mov    -0x10(%ebp),%eax
 4cd:	01 d0                	add    %edx,%eax
 4cf:	0f b6 00             	movzbl (%eax),%eax
 4d2:	0f be c0             	movsbl %al,%eax
 4d5:	25 ff 00 00 00       	and    $0xff,%eax
 4da:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(state == 0){
 4dd:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 4e1:	75 2c                	jne    50f <printf+0x6a>
      if(c == '%'){
 4e3:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 4e7:	75 0c                	jne    4f5 <printf+0x50>
        state = '%';
 4e9:	c7 45 ec 25 00 00 00 	movl   $0x25,-0x14(%ebp)
 4f0:	e9 27 01 00 00       	jmp    61c <printf+0x177>
      } else {
        putc(fd, c);
 4f5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 4f8:	0f be c0             	movsbl %al,%eax
 4fb:	83 ec 08             	sub    $0x8,%esp
 4fe:	50                   	push   %eax
 4ff:	ff 75 08             	push   0x8(%ebp)
 502:	e8 ca fe ff ff       	call   3d1 <putc>
 507:	83 c4 10             	add    $0x10,%esp
 50a:	e9 0d 01 00 00       	jmp    61c <printf+0x177>
      }
    } else if(state == '%'){
 50f:	83 7d ec 25          	cmpl   $0x25,-0x14(%ebp)
 513:	0f 85 03 01 00 00    	jne    61c <printf+0x177>
      if(c == 'd'){
 519:	83 7d e4 64          	cmpl   $0x64,-0x1c(%ebp)
 51d:	75 1e                	jne    53d <printf+0x98>
        printint(fd, *ap, 10, 1);
 51f:	8b 45 e8             	mov    -0x18(%ebp),%eax
 522:	8b 00                	mov    (%eax),%eax
 524:	6a 01                	push   $0x1
 526:	6a 0a                	push   $0xa
 528:	50                   	push   %eax
 529:	ff 75 08             	push   0x8(%ebp)
 52c:	e8 c3 fe ff ff       	call   3f4 <printint>
 531:	83 c4 10             	add    $0x10,%esp
        ap++;
 534:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 538:	e9 d8 00 00 00       	jmp    615 <printf+0x170>
      } else if(c == 'x' || c == 'p'){
 53d:	83 7d e4 78          	cmpl   $0x78,-0x1c(%ebp)
 541:	74 06                	je     549 <printf+0xa4>
 543:	83 7d e4 70          	cmpl   $0x70,-0x1c(%ebp)
 547:	75 1e                	jne    567 <printf+0xc2>
        printint(fd, *ap, 16, 0);
 549:	8b 45 e8             	mov    -0x18(%ebp),%eax
 54c:	8b 00                	mov    (%eax),%eax
 54e:	6a 00                	push   $0x0
 550:	6a 10                	push   $0x10
 552:	50                   	push   %eax
 553:	ff 75 08             	push   0x8(%ebp)
 556:	e8 99 fe ff ff       	call   3f4 <printint>
 55b:	83 c4 10             	add    $0x10,%esp
        ap++;
 55e:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 562:	e9 ae 00 00 00       	jmp    615 <printf+0x170>
      } else if(c == 's'){
 567:	83 7d e4 73          	cmpl   $0x73,-0x1c(%ebp)
 56b:	75 43                	jne    5b0 <printf+0x10b>
        s = (char*)*ap;
 56d:	8b 45 e8             	mov    -0x18(%ebp),%eax
 570:	8b 00                	mov    (%eax),%eax
 572:	89 45 f4             	mov    %eax,-0xc(%ebp)
        ap++;
 575:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
        if(s == 0)
 579:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 57d:	75 25                	jne    5a4 <printf+0xff>
          s = "(null)";
 57f:	c7 45 f4 64 08 00 00 	movl   $0x864,-0xc(%ebp)
        while(*s != 0){
 586:	eb 1c                	jmp    5a4 <printf+0xff>
          putc(fd, *s);
 588:	8b 45 f4             	mov    -0xc(%ebp),%eax
 58b:	0f b6 00             	movzbl (%eax),%eax
 58e:	0f be c0             	movsbl %al,%eax
 591:	83 ec 08             	sub    $0x8,%esp
 594:	50                   	push   %eax
 595:	ff 75 08             	push   0x8(%ebp)
 598:	e8 34 fe ff ff       	call   3d1 <putc>
 59d:	83 c4 10             	add    $0x10,%esp
          s++;
 5a0:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
        while(*s != 0){
 5a4:	8b 45 f4             	mov    -0xc(%ebp),%eax
 5a7:	0f b6 00             	movzbl (%eax),%eax
 5aa:	84 c0                	test   %al,%al
 5ac:	75 da                	jne    588 <printf+0xe3>
 5ae:	eb 65                	jmp    615 <printf+0x170>
        }
      } else if(c == 'c'){
 5b0:	83 7d e4 63          	cmpl   $0x63,-0x1c(%ebp)
 5b4:	75 1d                	jne    5d3 <printf+0x12e>
        putc(fd, *ap);
 5b6:	8b 45 e8             	mov    -0x18(%ebp),%eax
 5b9:	8b 00                	mov    (%eax),%eax
 5bb:	0f be c0             	movsbl %al,%eax
 5be:	83 ec 08             	sub    $0x8,%esp
 5c1:	50                   	push   %eax
 5c2:	ff 75 08             	push   0x8(%ebp)
 5c5:	e8 07 fe ff ff       	call   3d1 <putc>
 5ca:	83 c4 10             	add    $0x10,%esp
        ap++;
 5cd:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 5d1:	eb 42                	jmp    615 <printf+0x170>
      } else if(c == '%'){
 5d3:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 5d7:	75 17                	jne    5f0 <printf+0x14b>
        putc(fd, c);
 5d9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 5dc:	0f be c0             	movsbl %al,%eax
 5df:	83 ec 08             	sub    $0x8,%esp
 5e2:	50                   	push   %eax
 5e3:	ff 75 08             	push   0x8(%ebp)
 5e6:	e8 e6 fd ff ff       	call   3d1 <putc>
 5eb:	83 c4 10             	add    $0x10,%esp
 5ee:	eb 25                	jmp    615 <printf+0x170>
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
 5f0:	83 ec 08             	sub    $0x8,%esp
 5f3:	6a 25                	push   $0x25
 5f5:	ff 75 08             	push   0x8(%ebp)
 5f8:	e8 d4 fd ff ff       	call   3d1 <putc>
 5fd:	83 c4 10             	add    $0x10,%esp
        putc(fd, c);
 600:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 603:	0f be c0             	movsbl %al,%eax
 606:	83 ec 08             	sub    $0x8,%esp
 609:	50                   	push   %eax
 60a:	ff 75 08             	push   0x8(%ebp)
 60d:	e8 bf fd ff ff       	call   3d1 <putc>
 612:	83 c4 10             	add    $0x10,%esp
      }
      state = 0;
 615:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  for(i = 0; fmt[i]; i++){
 61c:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
 620:	8b 55 0c             	mov    0xc(%ebp),%edx
 623:	8b 45 f0             	mov    -0x10(%ebp),%eax
 626:	01 d0                	add    %edx,%eax
 628:	0f b6 00             	movzbl (%eax),%eax
 62b:	84 c0                	test   %al,%al
 62d:	0f 85 94 fe ff ff    	jne    4c7 <printf+0x22>
    }
  }
}
 633:	90                   	nop
 634:	90                   	nop
 635:	c9                   	leave  
 636:	c3                   	ret    

00000637 <free>:
static Header base;
static Header *freep;

void
free(void *ap)
{
 637:	55                   	push   %ebp
 638:	89 e5                	mov    %esp,%ebp
 63a:	83 ec 10             	sub    $0x10,%esp
  Header *bp, *p;

  bp = (Header*)ap - 1;
 63d:	8b 45 08             	mov    0x8(%ebp),%eax
 640:	83 e8 08             	sub    $0x8,%eax
 643:	89 45 f8             	mov    %eax,-0x8(%ebp)
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 646:	a1 cc 0a 00 00       	mov    0xacc,%eax
 64b:	89 45 fc             	mov    %eax,-0x4(%ebp)
 64e:	eb 24                	jmp    674 <free+0x3d>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
 650:	8b 45 fc             	mov    -0x4(%ebp),%eax
 653:	8b 00                	mov    (%eax),%eax
 655:	39 45 fc             	cmp    %eax,-0x4(%ebp)
 658:	72 12                	jb     66c <free+0x35>
 65a:	8b 45 f8             	mov    -0x8(%ebp),%eax
 65d:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 660:	77 24                	ja     686 <free+0x4f>
 662:	8b 45 fc             	mov    -0x4(%ebp),%eax
 665:	8b 00                	mov    (%eax),%eax
 667:	39 45 f8             	cmp    %eax,-0x8(%ebp)
 66a:	72 1a                	jb     686 <free+0x4f>
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 66c:	8b 45 fc             	mov    -0x4(%ebp),%eax
 66f:	8b 00                	mov    (%eax),%eax
 671:	89 45 fc             	mov    %eax,-0x4(%ebp)
 674:	8b 45 f8             	mov    -0x8(%ebp),%eax
 677:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 67a:	76 d4                	jbe    650 <free+0x19>
 67c:	8b 45 fc             	mov    -0x4(%ebp),%eax
 67f:	8b 00                	mov    (%eax),%eax
 681:	39 45 f8             	cmp    %eax,-0x8(%ebp)
 684:	73 ca                	jae    650 <free+0x19>
      break;
  if(bp + bp->s.size == p->s.ptr){
 686:	8b 45 f8             	mov    -0x8(%ebp),%eax
 689:	8b 40 04             	mov    0x4(%eax),%eax
 68c:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
 693:	8b 45 f8             	mov    -0x8(%ebp),%eax
 696:	01 c2                	add    %eax,%edx
 698:	8b 45 fc             	mov    -0x4(%ebp),%eax
 69b:	8b 00                	mov    (%eax),%eax
 69d:	39 c2                	cmp    %eax,%edx
 69f:	75 24                	jne    6c5 <free+0x8e>
    bp->s.size += p->s.ptr->s.size;
 6a1:	8b 45 f8             	mov    -0x8(%ebp),%eax
 6a4:	8b 50 04             	mov    0x4(%eax),%edx
 6a7:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6aa:	8b 00                	mov    (%eax),%eax
 6ac:	8b 40 04             	mov    0x4(%eax),%eax
 6af:	01 c2                	add    %eax,%edx
 6b1:	8b 45 f8             	mov    -0x8(%ebp),%eax
 6b4:	89 50 04             	mov    %edx,0x4(%eax)
    bp->s.ptr = p->s.ptr->s.ptr;
 6b7:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6ba:	8b 00                	mov    (%eax),%eax
 6bc:	8b 10                	mov    (%eax),%edx
 6be:	8b 45 f8             	mov    -0x8(%ebp),%eax
 6c1:	89 10                	mov    %edx,(%eax)
 6c3:	eb 0a                	jmp    6cf <free+0x98>
  } else
    bp->s.ptr = p->s.ptr;
 6c5:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6c8:	8b 10                	mov    (%eax),%edx
 6ca:	8b 45 f8             	mov    -0x8(%ebp),%eax
 6cd:	89 10                	mov    %edx,(%eax)
  if(p + p->s.size == bp){
 6cf:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6d2:	8b 40 04             	mov    0x4(%eax),%eax
 6d5:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
 6dc:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6df:	01 d0                	add    %edx,%eax
 6e1:	39 45 f8             	cmp    %eax,-0x8(%ebp)
 6e4:	75 20                	jne    706 <free+0xcf>
    p->s.size += bp->s.size;
 6e6:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6e9:	8b 50 04             	mov    0x4(%eax),%edx
 6ec:	8b 45 f8             	mov    -0x8(%ebp),%eax
 6ef:	8b 40 04             	mov    0x4(%eax),%eax
 6f2:	01 c2                	add    %eax,%edx
 6f4:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6f7:	89 50 04             	mov    %edx,0x4(%eax)
    p->s.ptr = bp->s.ptr;
 6fa:	8b 45 f8             	mov    -0x8(%ebp),%eax
 6fd:	8b 10                	mov    (%eax),%edx
 6ff:	8b 45 fc             	mov    -0x4(%ebp),%eax
 702:	89 10                	mov    %edx,(%eax)
 704:	eb 08                	jmp    70e <free+0xd7>
  } else
    p->s.ptr = bp;
 706:	8b 45 fc             	mov    -0x4(%ebp),%eax
 709:	8b 55 f8             	mov    -0x8(%ebp),%edx
 70c:	89 10                	mov    %edx,(%eax)
  freep = p;
 70e:	8b 45 fc             	mov    -0x4(%ebp),%eax
 711:	a3 cc 0a 00 00       	mov    %eax,0xacc
}
 716:	90                   	nop
 717:	c9                   	leave  
 718:	c3                   	ret    

00000719 <morecore>:

static Header*
morecore(uint nu)
{
 719:	55                   	push   %ebp
 71a:	89 e5                	mov    %esp,%ebp
 71c:	83 ec 18             	sub    $0x18,%esp
  char *p;
  Header *hp;

  if(nu < 4096)
 71f:	81 7d 08 ff 0f 00 00 	cmpl   $0xfff,0x8(%ebp)
 726:	77 07                	ja     72f <morecore+0x16>
    nu = 4096;
 728:	c7 45 08 00 10 00 00 	movl   $0x1000,0x8(%ebp)
  p = sbrk(nu * sizeof(Header));
 72f:	8b 45 08             	mov    0x8(%ebp),%eax
 732:	c1 e0 03             	shl    $0x3,%eax
 735:	83 ec 0c             	sub    $0xc,%esp
 738:	50                   	push   %eax
 739:	e8 6b fc ff ff       	call   3a9 <sbrk>
 73e:	83 c4 10             	add    $0x10,%esp
 741:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(p == (char*)-1)
 744:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
 748:	75 07                	jne    751 <morecore+0x38>
    return 0;
 74a:	b8 00 00 00 00       	mov    $0x0,%eax
 74f:	eb 26                	jmp    777 <morecore+0x5e>
  hp = (Header*)p;
 751:	8b 45 f4             	mov    -0xc(%ebp),%eax
 754:	89 45 f0             	mov    %eax,-0x10(%ebp)
  hp->s.size = nu;
 757:	8b 45 f0             	mov    -0x10(%ebp),%eax
 75a:	8b 55 08             	mov    0x8(%ebp),%edx
 75d:	89 50 04             	mov    %edx,0x4(%eax)
  free((void*)(hp + 1));
 760:	8b 45 f0             	mov    -0x10(%ebp),%eax
 763:	83 c0 08             	add    $0x8,%eax
 766:	83 ec 0c             	sub    $0xc,%esp
 769:	50                   	push   %eax
 76a:	e8 c8 fe ff ff       	call   637 <free>
 76f:	83 c4 10             	add    $0x10,%esp
  return freep;
 772:	a1 cc 0a 00 00       	mov    0xacc,%eax
}
 777:	c9                   	leave  
 778:	c3                   	ret    

00000779 <malloc>:

void*
malloc(uint nbytes)
{
 779:	55                   	push   %ebp
 77a:	89 e5                	mov    %esp,%ebp
 77c:	83 ec 18             	sub    $0x18,%esp
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
 77f:	8b 45 08             	mov    0x8(%ebp),%eax
 782:	83 c0 07             	add    $0x7,%eax
 785:	c1 e8 03             	shr    $0x3,%eax
 788:	83 c0 01             	add    $0x1,%eax
 78b:	89 45 ec             	mov    %eax,-0x14(%ebp)
  if((prevp = freep) == 0){
 78e:	a1 cc 0a 00 00       	mov    0xacc,%eax
 793:	89 45 f0             	mov    %eax,-0x10(%ebp)
 796:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 79a:	75 23                	jne    7bf <malloc+0x46>
    base.s.ptr = freep = prevp = &base;
 79c:	c7 45 f0 c4 0a 00 00 	movl   $0xac4,-0x10(%ebp)
 7a3:	8b 45 f0             	mov    -0x10(%ebp),%eax
 7a6:	a3 cc 0a 00 00       	mov    %eax,0xacc
 7ab:	a1 cc 0a 00 00       	mov    0xacc,%eax
 7b0:	a3 c4 0a 00 00       	mov    %eax,0xac4
    base.s.size = 0;
 7b5:	c7 05 c8 0a 00 00 00 	movl   $0x0,0xac8
 7bc:	00 00 00 
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 7bf:	8b 45 f0             	mov    -0x10(%ebp),%eax
 7c2:	8b 00                	mov    (%eax),%eax
 7c4:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if(p->s.size >= nunits){
 7c7:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7ca:	8b 40 04             	mov    0x4(%eax),%eax
 7cd:	39 45 ec             	cmp    %eax,-0x14(%ebp)
 7d0:	77 4d                	ja     81f <malloc+0xa6>
      if(p->s.size == nunits)
 7d2:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7d5:	8b 40 04             	mov    0x4(%eax),%eax
 7d8:	39 45 ec             	cmp    %eax,-0x14(%ebp)
 7db:	75 0c                	jne    7e9 <malloc+0x70>
        prevp->s.ptr = p->s.ptr;
 7dd:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7e0:	8b 10                	mov    (%eax),%edx
 7e2:	8b 45 f0             	mov    -0x10(%ebp),%eax
 7e5:	89 10                	mov    %edx,(%eax)
 7e7:	eb 26                	jmp    80f <malloc+0x96>
      else {
        p->s.size -= nunits;
 7e9:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7ec:	8b 40 04             	mov    0x4(%eax),%eax
 7ef:	2b 45 ec             	sub    -0x14(%ebp),%eax
 7f2:	89 c2                	mov    %eax,%edx
 7f4:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7f7:	89 50 04             	mov    %edx,0x4(%eax)
        p += p->s.size;
 7fa:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7fd:	8b 40 04             	mov    0x4(%eax),%eax
 800:	c1 e0 03             	shl    $0x3,%eax
 803:	01 45 f4             	add    %eax,-0xc(%ebp)
        p->s.size = nunits;
 806:	8b 45 f4             	mov    -0xc(%ebp),%eax
 809:	8b 55 ec             	mov    -0x14(%ebp),%edx
 80c:	89 50 04             	mov    %edx,0x4(%eax)
      }
      freep = prevp;
 80f:	8b 45 f0             	mov    -0x10(%ebp),%eax
 812:	a3 cc 0a 00 00       	mov    %eax,0xacc
      return (void*)(p + 1);
 817:	8b 45 f4             	mov    -0xc(%ebp),%eax
 81a:	83 c0 08             	add    $0x8,%eax
 81d:	eb 3b                	jmp    85a <malloc+0xe1>
    }
    if(p == freep)
 81f:	a1 cc 0a 00 00       	mov    0xacc,%eax
 824:	39 45 f4             	cmp    %eax,-0xc(%ebp)
 827:	75 1e                	jne    847 <malloc+0xce>
      if((p = morecore(nunits)) == 0)
 829:	83 ec 0c             	sub    $0xc,%esp
 82c:	ff 75 ec             	push   -0x14(%ebp)
 82f:	e8 e5 fe ff ff       	call   719 <morecore>
 834:	83 c4 10             	add    $0x10,%esp
 837:	89 45 f4             	mov    %eax,-0xc(%ebp)
 83a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 83e:	75 07                	jne    847 <malloc+0xce>
        return 0;
 840:	b8 00 00 00 00       	mov    $0x0,%eax
 845:	eb 13                	jmp    85a <malloc+0xe1>
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 847:	8b 45 f4             	mov    -0xc(%ebp),%eax
 84a:	89 45 f0             	mov    %eax,-0x10(%ebp)
 84d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 850:	8b 00                	mov    (%eax),%eax
 852:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if(p->s.size >= nunits){
 855:	e9 6d ff ff ff       	jmp    7c7 <malloc+0x4e>
  }
}
 85a:	c9                   	leave  
 85b:	c3                   	ret    
